<template>
  <div class="detail">
    <h3>
      商品详情
    </h3>
    <div>发布时间：{{data.time | date}}</div>
    <div>发布时间：{{4 | fillzero}}</div>
    <span>{{dataId}}</span>
    <div v-direc1="'ceshi'">direc1</div>
    <div v-direc2>{{title}}</div>
    <el-divider></el-divider>
    <uc-button></uc-button>
  </div>
</template>
<script>
import ucButton from '../../components/global/uc-button/uc-button.vue';
export default{
  components: { ucButton },
  name:'goods-detail',
  data:()=>({
      dataId:'',
      title:'no'
  }),
  validate({params,query}){
    return typeof params.id === 'string';
  },
  // middleware({store,route,redirect,params,query,req,res}){
  //   console.log("params***"+params.id);
  // },
  created() {
    console.log("created_____params***"+this.$route.params.id);
    this.dataId=this.$route.params.id;
  },
  asyncData({query,params,$axios}){
    return $axios({
      url:`/api/goods/${params.id}`
    }).then(
      res=>({
        // console.log(res.data.data);
        data:res.data.data
      })
    )
    ;
  },
  head(){
      return this.$seo(this.data.title,this.data.id,[{}]);
  },
  //transition:'动画名'
  transition:'test'
}
</script>
<style scoped>
  /* .test-enter-active,.test-leave-active{
       transition: .7s ease all;
  }
  .test-enter,.test-leave-active{
       margin-left: -1000px;
  } */
</style>>
